package com.example.demo.service.impl;

import com.example.demo.entity.ProjectEntity;
import com.example.demo.mapper.ProjectMapper;
import com.example.demo.service.ProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @DESCRIPTION:
 * @AUTOOR: Lee
 * @DATE: 2022年09月18日 1:18
 */
@Service
public class ProjectServiceImpl implements ProjectService {

    private final ProjectMapper projectMapper;

    @Autowired
    public ProjectServiceImpl(ProjectMapper projectMapper) {
        this.projectMapper = projectMapper;
    }

    @Override
    public ProjectEntity create(ProjectEntity project) {
        projectMapper.insert(project);
        return project;
    }

    @Override
    public ProjectEntity get(Integer projectId) {
        return projectMapper.selectById(projectId);
    }

}
